import { request } from 'umi';

export async function fakeSubmitForm(params: any) {
    return request('/api/doctor/save', {
        method: 'POST',
        data: params,
    });
}

export async function queryDetail(params: any) {
    return request('/api/doctor/' + params.id, {
        method: 'get',
        data: params,
    });
}
export async function hospitalInfo(params: any) {
    return request('/api/hospitalInfo/page?pageNum=1&pageSize=10&vague=' + params.vague, {
        method: 'get',
        data: params,
    });
}
export async function articlepp(params: any) {
    return request('api/pages/activity/article', {
        method: 'post',
        data: params,
    });
}
//
export async function queryAuthDoctorDetail(params: any) {
    return request('/api/doctorAttestation/current', {
        method: 'get',
        data: params,
    });
}
export async function doctorAttestation(params: any) {
    return request('/api/doctorAttestation/save', {
        method: 'post',
        data: params,
    });
}
export async function listByCode(params: any) {
    return request('/api/bsDict/listByCode', {
        method: 'post',
        data: params,
    });
}

export async function approveDoctor(params: any) {
    return request('/api/doctorAttestation/reviewDoctorCertificationInfo', {
        method: 'POST',
        data: params,
    });
}

export async function list(params: any) {
    return request('/api/doctor/page', {
        method: 'POST',
        data: params,
    });
}

export async function authlist(params: any) {
    return request('/api/doctorAttestation/page', {
        method: 'POST',
        data: params,
    });
}

export async function updateStatus(params: any) {
    return request('/api/doctor/status', {
        method: 'POST',
        data: params,
    });
}

export async function updateTop(params: any) {
    return request('/api/doctor/isTop', {
        method: 'POST',
        data: params,
    });
}

/** 修改文章 PUT /api/ */
export async function update(params: any) {
    return request('/api/doctor/edit', {
        method: 'PUT',
        data: params,
    });
}

/** 删除文章 DELETE /api/ */
export async function remove(data: { key: number[] }, options?: { [key: string]: any }) {
    return request<Record<string, any>>('/api/doctor/' + data.key, {
        data,
        method: 'DELETE',
        ...(options || {}),
    });
}
